import { Controller, Post, Body, Req } from '@nestjs/common';
import { CommentService } from './comment.service';
import { CreateCommentDto } from './dto/create-comment.dto';
import { LogAction } from 'src/auth/utils/logging.metadata';

@Controller('comment')
export class CommentController {
  constructor(private readonly commentService: CommentService) {}

  @LogAction('创建评论')
  @Post()
  create(@Body() createCommentDto: CreateCommentDto, @Req() req: AuthRequest) {
    return this.commentService.create(createCommentDto, req.user.userId);
  }

  // @Get()
  // findAll() {
  //   return this.commentService.findAll();
  // }

  // @Get(':id')
  // findOne(@Param('id') id: string) {
  //   return this.commentService.findOne(+id);
  // }

  // @Patch(':id')
  // update(@Param('id') id: string, @Body() updateCommentDto: UpdateCommentDto) {
  //   return this.commentService.update(+id, updateCommentDto);
  // }

  // @Delete(':id')
  // remove(@Param('id') id: string) {
  //   return this.commentService.remove(+id);
  // }
}
